home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / util / boot / snap_v2_0.lha / Snap / Rexx.c < prev    next >
C/C++ Source or Header  |  1995-09-04  |  863b  |  50 lines

  1. /* Auto: make
  2.  */
  3.  
  4. #include "Snap.h"
  5.  
  6. #include "proto/MinRexx.h"
  7.  
  8. #include "minrexx.h"
  9.  
  10. IMPORT struct SnapRsrc *SnapRsrc;
  11.  
  12. VOID rexxprepend(), rexxappend();
  13. int disp( register struct RexxMsg *msg, register struct rexxCommandList *dat, char *p);
  14.  
  15. struct rexxCommandList rcl[] =
  16. {
  17.     {"prepend", (APTR) & rexxprepend},
  18.     {"append", (APTR) & rexxappend},
  19.     {NULL, NULL}
  20. };
  21.  
  22. char result[17];
  23.  
  24. int disp( register struct RexxMsg *msg, register struct rexxCommandList *dat, char *p)
  25. {
  26.     result[0] = '\0';
  27.     ((int (*)())(dat->userdata)) (msg, p);
  28.     replyRexxCmd(msg, 0L, 0L, &result[0]);
  29.     return 1;
  30. }
  31.  
  32. VOID pend( char *addr, char *p)
  33. {
  34.     strcpy(&result[0], addr);
  35.     if (*p)
  36.     {
  37.         strncpy(addr, p + 1, 16);
  38.     }
  39. }
  40.  
  41. VOID rexxprepend( struct RexxMsg *msg, char *p)
  42. {
  43.     pend(&SnapRsrc->Prepend[0], p);
  44. }
  45.  
  46. VOID rexxappend( struct RexxMsg *msg, char *p)
  47. {
  48.     pend(&SnapRsrc->Append[0], p);
  49. }
  50.